Puppet::Type.newtype(:peer) do
    @doc = "Ourgrid peer"

	#A base class for numeric Virt parameters validation.
	class VirtNumericParam < Puppet::Parameter

		def numfix(num)
			if num =~ /^\d+$/
				return num.to_i
			elsif num.is_a?(Integer)
				return num
			else
				return false
			end
		end

		validate do |value|
			if numfix(value)
				return value
			else
				self.fail "%s is not a valid %s" % [value, self.class.name]
			end
		end
	end


    ensurable

	newparam(:name, :varname => true) do
		desc "Name of resorce"
	end

    newproperty(:cpuunit, :parent => VirtNumericParam) do
        desc "cpuunit"
    end

    newproperty(:longitude, :parent => VirtNumericParam) do
        desc "longitude"
    end

    newproperty(:description) do
        desc "description"
    end

    newproperty(:joincommunity) do
        desc "joincommunity"
    end

    newproperty(:latitude, :parent => VirtNumericParam) do
        desc "latitude"
    end

    newproperty(:intervalsaving) do
        desc "intervalsaving"
    end

    newproperty(:dataunit, :parent => VirtNumericParam) do
        desc "dataunit"
    end

    newproperty(:repeatrequest) do
        desc "repeatrequest"
    end

    newproperty(:label) do
        desc "label"
    end

    newproperty(:sdf) do
        desc "sdf"
    end

    newproperty(:email) do
        desc "email"
    end

    newproperty(:network) do
        desc "network"
    end		

    newproperty(:update) do
        desc "update"
    end		

    newproperty(:confdir) do
        desc "confdir"
    end		

    newproperty(:publickey) do
        desc "publickey"
    end	

    newproperty(:privatekey) do
        desc "privatekey"
    end		

    newproperty(:username) do
        desc "username"
    end		

    newproperty(:password) do
        desc "password"
    end		

    newproperty(:servername) do
        desc "servername"
    end	

    newproperty(:requestingcertpath) do
        desc "requestingcertpath"
    end	

    newproperty(:receivingcertpath) do
        desc "receivingcertpath"
    end			

end
